﻿"use strict";

window.ArthurGraus = window.ArthurGraus || {};

var adRotatorAppPartTest;

$(document).ready(function () {
    adRotatorAppPartTest = new ArthurGraus.AdRotatorAppPartTest();
    adRotatorAppPartTest.initialize();
});

ArthurGraus.AdRotatorAppPartTest = function () {
    var self = this;
    self.analytics = null;

    self.initialize = function () {
        self.analytics = new ArthurGraus.Analytics('ADRO');
        self.analytics.initialize();
    };
};

function getQuerystring(key, default_) {
    if (default_ == null) default_ = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if (qs == null)
        return default_;
    else
        return qs[1];
}
function getQuerystringFromString(url, key, default_) {
    if (default_ == null) default_ = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(url);
    if (qs == null)
        return default_;
    else
        return qs[1];
}

function htmlEscape(str) {
    return String(str)
            .replace(/&/g, '&amp;')
            .replace(/"/g, '&quot;')
            .replace(/'/g, '&#39;')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;')
            .replace(/ /g, '&nbsp;')
            .replace(/\n/g, '<br />');
}





